package xyz.masaikk.mvv;

import java.sql.*;

public class Jmv {
    public void getData() throws ClassNotFoundException, SQLException {
        SqlProp sqlProp=new SqlProp();

        Class.forName("com.mysql.jdbc.Driver");
        Connection con= DriverManager.getConnection(sqlProp.getURL(),sqlProp.getName(),sqlProp.getPwd());
        PreparedStatement pst=con.prepareStatement("select charactor,sentence from vmessage");
        ResultSet rs=pst.executeQuery();
        while(rs.next()){
            System.out.println(rs.getString("charactor")+" "+rs.getString("sentence"));
        }
        rs.close();
        pst.close();
        con.close();

    }
}
